package com.itheima.service;

import com.itheima.domain.Account;
import com.itheima.mapper.AccountMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

//注意 当类名与被调用处的名称不一样 ，需要配置注解里的value属性值为被调用处的名称
@Service("accountService")
public class AccountServiceImpl implements AccountSercice {

    @Autowired
    private AccountMapper accountMapper;

    public void save(Account account) {
        accountMapper.save (account);
    }

    public List<Account> findAll() {
        List<Account> accountList = accountMapper.findAll ();
        return accountList;
    }
}
